<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>个人信息修改，我的评论</title>
    
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <!-- bootstrap -->
    <link href="/static/bootstrap/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="/static/bootstrap/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="/static/bootstrap/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />


    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="/static/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/elements.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/icons.css" />



    <!-- this page specific styles 游泳-->
    <link rel="stylesheet" href="/static/css/personal-info.css" type="text/css" media="screen" />

    <!-- open sans font
    <link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' /> -->


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<style>
    #back{
        margin-left: 50px;
    }

</style>
<body>

    <!-- end navbar -->

	<!-- main container .wide-content is used for this layout without sidebar :)  -->
    <div class="content wide-content">
        <div class="container-fluid">
            <div class="settings-wrapper" id="pad-wrapper">
                <!-- edit form column -->
                <div class="span5 personal-info" th:object="${user}">
                    <h5 class="personal-title">个人信息修改</h5>

                    <form th:action="@{/user/updatePersonal}" method="post">
                        <div>
                            <input type="hidden" name="id" id="userid" th:value="*{id}">
                        </div>
                        <div class="field-box">
                            <label>用户名:</label>
                            <input type="text" class="span5 inline-input" id="edit_userName" placeholder="用户名称" name="userName" th:value="*{userName}" />
                        </div>
                        <div class="field-box">
                            <label>密码:</label>
                            <input type="text" class="span5 inline-input" id="edit_password" placeholder="用户密码" name="password" th:value="*{password}"/>
                        </div>
                        <div class="field-box">
                            <label>年龄:</label>
                            <input type="text" class="span5 inline-input" id="edit_age" placeholder="年龄" name="age" th:value="*{age}"/>
                        </div>
                        <div class="field-box">
                            <label>性别:</label>
                            <div class="ui-select">
                            <select id="edit_sex" name="sex">
                                <option th:selected="${user.sex==0}" value="0">男</option>
                                <option th:selected="${user.sex==1}" value="1">女</option>

                            </select>
                            </div>
                        </div>

                        <div class="field-box">
                            <label>电话:</label>
                            <input type="text" class="span5 inline-input" id="edit_telephone" placeholder="电话" name="phone" th:value="*{phone}" />
                        </div>
                        <div class="field-box">
                            <label>Email:</label>
                            <input type="text" class="span5 inline-input" id="edit_Email" placeholder="Email"  name="email" th:value="*{email}"/>
                        </div>

                        <div class="field-box">
                            <label>地址:</label>
                            <input type="text" class="span5 inline-input" id="edit_address" placeholder="地址" name="address" th:value="*{address}"/>
                        </div>

                        <div class="span6 field-box actions">
                            <input type="submit" class="btn-glow primary" value="提交修改" />
                            <input type="button" class="btn-glow primary" value="返回" id="back">
                        </div>
                    </form>
                </div>
                <div class="span5 personal-info " style="margin-left:80px;">
                    <h5 class="personal-title">我的评论</h5>
                    <table  class="table" >
                        <thead>
                        <tr>
                          <th scope="col">评论对象</th>
                          <th scope="col">评论内容</th>
                          <th scope="col">评论时间</th>
                          <th scope="col">是否删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="list:${comList}">
                          <th scope="row" th:text="${list.petName}"></th>
                          <td th:text="${list.comment}"></td>
                          <td th:text="${#dates.format(list.commentTime,'yyyy-MM-dd')}"></td>
                          <td><a th:href="@{'/user/delCommentById?id='+${list.id}+'&userId='+${user.id}}">删除评论</a></td>
                        </tr>
                        </tbody>
                        </table>
                </div>
            </div>
        </div>
    </div>
    <script src="/static/js/jquery-2.2.3.min.js"></script>
<script>
    $(function(){

        $("#back").on('click',function(){
           history.back();
        });
    })
</script>
</body>
</html>